// CSS3常用动画类: 用于消息显示、页面切换、弹出层等
// mt-page-fade
// mt-fade、mt-notice-slide-down、mt-slide-down、mt-slide-up、
// mt-slide-left、mt-slide-right、mt-toast-fade、mt-zoom

.mt-page-fade{
  &-enter {
    opacity: 0;
    animation-duration: .2s;
    animation-fill-mode: both;
    animation-timing-function: cubic-bezier(0.55, 0, 0.55, 0.2);
    animation-play-state: paused;
  }

  &-enter {
    opacity: 0;
    animation-duration: .2s;
    animation-fill-mode: both;
    animation-timing-function: cubic-bezier(0.55, 0, 0.55, 0.2);
    animation-play-state: paused;
  }

  &-leave {
    animation-duration: .2s;
    animation-fill-mode: both;
    animation-timing-function: cubic-bezier(0.55, 0, 0.55, 0.2);
    animation-play-state: paused;
  }

  &-enter&-enter-active {
    animation-name: pageFadeIn;
    animation-play-state: running;
  }

  &-leave&-leave-active {
    animation-name: pageFadeOut;
    animation-play-state: running;
  }
}

@keyframes pageFadeIn {
  0% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}
@keyframes pageFadeOut {
  0% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}


// mt-fade
.mt{
  .effect() {
    animation-duration: 0.2s;
    animation-fill-mode: both;
    animation-timing-function: cubic-bezier(0.55, 0, 0.55, 0.2);
  }

  &-fade-enter,
  &-fade-appear {
    opacity: 0;
    .effect();
    animation-play-state: paused;
  }

  &-fade-leave {
    .effect();
    animation-play-state: paused;
  }

  &-fade-enter&-fade-enter-active,
  &-fade-appear&-fade-appear-active {
    animation-name: amFadeIn;
    animation-play-state: running;
  }

  &-fade-leave&-fade-leave-active {
    animation-name: amFadeOut;
    animation-play-state: running;
  }

  @keyframes amFadeIn {
    0% {
      opacity: 0;
    }
    100% {
      opacity: 1;
    }
  }

  @keyframes amFadeOut {
    0% {
      opacity: 1;
    }
    100% {
      opacity: 0;
    }
  }
}

// mt-notice-slide-down
.mt{
  .effect(){
    transition-property: all;
    transition-duration: .2s;
    transition-timing-function: cubic-bezier(0.4, 0, 0, 1.5);
  }
  &-notice-slide-down-enter,
  &-notice-slide-down-appear,
  &-notice-slide-down-leave {
    transform: translate3d(0, -100%, 0);
    opacity: 0;
    .effect();
  }
  &-notice-slide-down-enter-active{
    transform: translate3d(0, 0, 0);
    opacity: 1;
  }
  &-notice-slide-down-leave-active{
    transform: translate3d(0, -100%, 0);
    opacity: 0;
  }
}

// mt-slide-down
.mt{
  .effect(){
    transition-property: all;
    transition-duration: .2s;
    transition-timing-function: ease-in-out;
  }
  &-slide-down-enter,
  &-slide-down-appear,
  &-slide-down-leave {
    transform: translate3d(0, -100%, 0);
    opacity: 0;
    .effect();
  }
  &-slide-down-enter-active{
    transform: translate3d(0, 0, 0);
    opacity: 1;
  }
  &-slide-down-leave-active{
    transform: translate3d(0, -100%, 0);
    opacity: 0;
  }
}

// mt-slide-up
.mt{
  .effect(){
    transition-property: all;
    transition-duration: .2s;
    transition-timing-function: ease-in-out;
  }
  &-slide-up-enter,
  &-slide-up-appear,
  &-slide-up-leave {
    transform: translate3d(0, 100%, 0);
    opacity: 0;
    .effect();
  }
  &-slide-up-enter-active{
    transform: translate3d(0, 0, 0);
    opacity: 1;
  }
  &-slide-up-leave-active{
    transform: translate3d(0, 100%, 0);
    opacity: 0;
  }
}

// mt-slide-left
.mt{
  .effect(){
    transition-property: all;
    transition-duration: .2s;
    transition-timing-function: ease-in-out;
  }
  &-slide-left-enter,
  &-slide-left-appear,
  &-slide-left-leave {
    transform: translate3d(-100%, 0, 0);
    opacity: 0;
    .effect();
  }
  &-slide-left-enter-active{
    transform: translate3d(0, 0, 0);
    opacity: 1;
  }
  &-slide-left-leave-active{
    transform: translate3d( -100%, 0, 0);
    opacity: 0;
  }
}

// mt-slide-right
.mt{
  .effect(){
    transition-property: all;
    transition-duration: .2s;
    transition-timing-function: ease-in-out;
  }
  &-slide-right-enter,
  &-slide-right-appear,
  &-slide-right-leave {
    transform: translate3d(100%, 0, 0);
    opacity: 0;
    .effect();
  }
  &-slide-right-enter-active{
    transform: translate3d(0, 0, 0);
    opacity: 1;
  }
  &-slide-right-leave-active{
    transform: translate3d(100%, 0, 0);
    opacity: 0;
  }
}

// mt-toast-fade
.mt{
  .effect(){
    transition-property: all;
    transition-duration: .1s;
    transition-timing-function: ease-in;
  }
  &-toast-fade-enter,
  &-toast-fade-appear,
  &-toast-fade-leave {
    opacity: 0;
    .effect();
  }
  &-toast-fade-enter-active{
    opacity: 1;
  }
  &-toast-fade-leave-active{
    opacity: 0;
  }
}

// mt-scale-in
.mt-scale-in{
  .effect(){
    transition-property: transform;
    transition-duration: .2s;
    transition-timing-function: ease-in;
  }
  &-enter,
  &-appear,
  &-leave {
    transform: scale(1.1);
    opacity: 0;
    .effect();
  }
  &-enter-active{
    opacity: 1;
  }
  &-leave-active{
    transform: scale(1.1);
    opacity: 0;
  }
}




// mt-zoom
.mt {
  .effect() {
    animation-duration: 0.2s;
    animation-fill-mode: both;
    animation-timing-function: cubic-bezier(0.55, 0, 0.55, 0.2);
  }
  &&-zoom-enter,
  &&-zoom-leave {
    display: block;
  }

  &-zoom-enter,
  &-zoom-appear {
    opacity: 0;
    .effect();
    animation-timing-function: cubic-bezier(0.18, 0.89, 0.32, 1.28);
    animation-play-state: paused;
  }

  &-zoom-leave {
    .effect();
    animation-timing-function: cubic-bezier(0.6, -0.3, 0.74, 0.05);
    animation-play-state: paused;
  }

  &-zoom-enter&-zoom-enter-active,
  &-zoom-appear&-zoom-appear-active {
    animation-name: amZoomIn;
    animation-play-state: running;
  }

  &-zoom-leave&-zoom-leave-active {
    animation-name: amZoomOut;
    animation-play-state: running;
  }

  @keyframes amZoomIn {
    0% {
      opacity: 0;
      transform-origin: 50% 50%;
      transform: scale(0, 0);
    }
    100% {
      opacity: 1;
      transform-origin: 50% 50%;
      transform: scale(1, 1);
    }
  }
  @keyframes amZoomOut {
    0% {
      opacity: 1;
      transform-origin: 50% 50%;
      transform: scale(1, 1);
    }
    100% {
      opacity: 0;
      transform-origin: 50% 50%;
      transform: scale(0, 0);
    }
  }
}
